package com.umedcn.Tools;

import com.alibaba.fastjson.JSONObject;

/**
 * Created by jiangadam on 2017/8/3.
 */
public class Tools {

    public static Tools single = null;

    public static Tools getInstance(){
        if (single == null){
            single = new Tools();
        }
        return single;
    }

    public static JSONObject returnMissParams(){
        JSONObject data = new JSONObject();
        data.put("code", 0);
        data.put("msg", "缺少参数");
        data.put("response", false);
        data.put("data", "");
        return data;
    }

    public static JSONObject getJsonData(boolean response, String code, String message, Object data){
        JSONObject out = new JSONObject();
        out.put("response", response);
        out.put("code", code);
        out.put("message", message);
        out.put("data", data);
        return out;
    }
}
